package no.rodland.acc.action;

import com.opensymphony.xwork2.ActionSupport;
import org.apache.log4j.Logger;

@SuppressWarnings({"UnusedDeclaration"})
public class LoginAction extends ActionSupport {

    private String username;

    private String password;

    private static final long serialVersionUID = 2437345594294228280L;

    private static final Logger log = Logger.getLogger(LoginAction.class);

    @Override
    public String execute() {
        if(username.equals("test") && password.equals("test")) {
            return SUCCESS;
        } else {
            addActionError("Wrong username or password");
            return ERROR;
        }
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }
}